import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Pages from  'vite-plugin-pages'

export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      imports:['vue','vue-router','pinia'] // 自动导入相关函数
    }),
    Pages({
      dirs:[ { dir: "src/views", baseRoute: "" }], // 修改默认文件夹
      importMode: "async"
    })
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
